//
//  PPMineOrderCell.m
//  PPDL
//
//  Created by 王洋 on 2019/8/7.
//  Copyright © 2019 王洋. All rights reserved.
//

#import "PPMineOrderCell.h"

@interface PPMineOrderCell ()

@property (weak, nonatomic) IBOutlet UIView *waitPay;
@property (weak, nonatomic) IBOutlet UIView *waitSend;
@property (weak, nonatomic) IBOutlet UIView *waitReceive;
@property (weak, nonatomic) IBOutlet UIView *invalidOrder;

@end

@implementation PPMineOrderCell

- (void)fillCellWithModel:(PPMineOrderModel *)model {
    
    
}


- (void)layoutSubviews {
    [super layoutSubviews];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.waitPay pp_clipCorners:UIRectCornerBottomLeft radius:20];
        [self.invalidOrder pp_clipCorners:UIRectCornerBottomRight radius:20];
    });
}

- (void)awakeFromNib {
    [super awakeFromNib];

    self.waitPay.userInteractionEnabled = YES;
    self.waitSend.userInteractionEnabled = YES;
    self.waitReceive.userInteractionEnabled = YES;
    self.invalidOrder.userInteractionEnabled = YES;

    [self.waitPay addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        
        if (self.handleOrderClickWithType) {
            self.handleOrderClickWithType(ETTOrderListType_UnPay);
        }
    }];
    
    [self.waitSend addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        
        if (self.handleOrderClickWithType) {
            self.handleOrderClickWithType(ETTOrderListType_UnSend);
        }
    }];
    
    [self.waitReceive addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        
        if (self.handleOrderClickWithType) {
            self.handleOrderClickWithType(ETTOrderListType_UnReceive);
        }
    }];
    
    [self.invalidOrder addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        
        if (self.handleOrderClickWithType) {
            self.handleOrderClickWithType(ETTOrderListType_Invalid - 5);
        }
    }];
}

@end
